home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #142 (199x)(Scope PD)(US)[WB].zip / Scope Disk #142 (199x)(Scope PD)(US)[WB].adf / LoadImage / PreInclude.c < prev    next >
C/C++ Source or Header  |  1990-07-30  |  3KB  |  112 lines

  1. /* $Revision Header * Header built automatically - do not edit! *************
  2.  *
  3.  *    (C) Copyright 1990 by MXM
  4.  *
  5.  *    Name .....: PreInclude.c
  6.  *    Created ..: Saturday 11-May-90 12:30
  7.  *    Revision .: 1
  8.  *
  9.  *    Date            Author          Comment
  10.  *    =========       ========        ====================
  11.  *    11-May-90       Olsen           Created this file!
  12.  *
  13.  * $Revision Header ********************************************************/
  14.  
  15. #include <intuition/intuitionbase.h>
  16. #include <libraries/dosextens.h>
  17. #include <libraries/arpbase.h>
  18. #include <workbench/startup.h>
  19. #include <graphics/gfxbase.h>
  20. #include <hardware/intbits.h>
  21. #include <exec/interrupts.h>
  22. #include <devices/printer.h>
  23. #include <exec/execbase.h>
  24. #include <graphics/view.h>
  25. #include <clib/macros.h>
  26. #include <exec/memory.h>
  27.  
  28. #define __NO_PRAGMAS
  29.  
  30. #include <functions.h>
  31.  
  32. #include <stddef.h>
  33. #include <stdlib.h>
  34. #include <string.h>
  35. #include <stdio.h>
  36. #include <fcntl.h>
  37. #include <stat.h>
  38.  
  39.     /* Some useful macros. */
  40.  
  41. #define LineBytes(n) (((n + 15) >> 4) << 1)    /* Word aligned width in bytes. */
  42.  
  43.     /* The real BitMapHeader... "I ain't 'fraid of no pic!" */
  44.  
  45. typedef struct
  46. {
  47.     UWORD w,h;            /* Raster width & height. */
  48.     UWORD x,y;            /* Pixel position. */
  49.     UBYTE nPlanes;            /* Number of source bitplanes. */
  50.     UBYTE masking;            /* Masking... maybe good for nothing. */
  51.     UBYTE compression;        /* Compressed or not? */
  52.     UBYTE pad1;            /* We don't like odd length structures. */
  53.     UWORD transparentColor;        /* Maybe good for... */
  54.     UBYTE xAspect, yAspect;        /* Kind of quotient, width / height. */
  55.     WORD pageWidth, pageHeight;    /* Source page size. */
  56. } BitMapHeader;
  57.  
  58.     /* The typical format of a DPaint colour cycling range. */
  59.  
  60. typedef struct
  61. {
  62.     WORD pad1;    /* Not used. */
  63.     WORD rate;    /* Cycling speed. */
  64.     WORD active;    /* Is it active? Which way is it cycling? */
  65.     UBYTE low,high;    /* Start and stop colour. */
  66. } CRange;
  67.  
  68.     /* The mystical, archetypical IFF chunk... */
  69.  
  70. typedef struct
  71. {
  72.     ULONG    IFF_Type;    /* Chunk type. */
  73.     LONG    IFF_Length;    /* Chunk length. */
  74. } IFF_Chunk;
  75.  
  76.     /* Miscellaneous error codes. */
  77.  
  78. #define ERR_NOIFF    1    /* Not an IFF-ILBM file. */
  79. #define ERR_NOCOLMAP    2    /* No colour map. */
  80. #define ERR_NOMEM    3    /* Not enough memory. */
  81. #define ERR_DOS        4    /* A DOS error. */
  82.  
  83.     /* Prototypes for Cycling.c . */
  84.  
  85. LONG    InitCycleCode(struct ViewPort *ViewPort,UWORD *ColMap,LONG ColNum,CRange *Range,LONG RangeNum);
  86. VOID    ClearCycleCode(VOID);
  87. VOID    ToggleCycleCode(VOID);
  88. LONG    IsCycling(VOID);
  89. LONG    LoadCycleRange(char *FileName,CRange *Range,LONG MaxRange);
  90.  
  91.     /* Prototypes for LoadImage.c */
  92.  
  93. ULONG    MakeID(char *IDString);
  94. LONG    FindChunk(char *ChunkName,FILE *FilePointer);
  95. LONG    LoadHeader(char *FileName,BitMapHeader *BMHeader);
  96. LONG    LoadCMAP(char *FileName,UWORD *ColourMap,LONG MaxCol,BitMapHeader *BMHeader);
  97. UBYTE    LoadRaster(char *FileName,PLANEPTR *BitPlanes,BitMapHeader *BMHeader);
  98. VOID    FadeTo(struct ViewPort *VPort,UWORD *From,UWORD *To,LONG NumColours,LONG ToCol,LONG FromCol);
  99. UBYTE    InitTinyBitMap(VOID);
  100. VOID    CleanExit(LONG ExitCode);
  101. VOID    CloseDisplay(VOID);
  102. VOID    PrintScreen(UBYTE Large);
  103. VOID    GetRealName(char *FullName,char *RealName);
  104. LONG    LoadImage(char *FileName,UBYTE ForceScroll,UBYTE ForceLace,UBYTE CycleOnStartup,UBYTE LastOne);
  105. VOID    QuickSort(char **av,LONG n);
  106. LONG    QSplit(char **av,LONG n);
  107.  
  108.     /* Pragmas for LoadImage.c */
  109.  
  110. #pragma regcall(MakeID(a0))
  111. #pragma regcall(FindChunk(a0,a1))
  112.